<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>传智健康</title>
    <meta name="description" content="传智健康">
    <meta name="keywords" content="传智健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    <script src="../js/healthmobile.js"></script>
    <style>
        .datatable {
            position: relative;
            box-sizing: border-box;
            -webkit-box-flex: 1;
            width: 100%;
            max-width: 100%;
            font-size: 14px;
            color: rgb(96, 98, 102);
            overflow: hidden;
            flex: 1 1 0%;
        }

        .datatable td, .datatable th {
            padding: 12px 0;
            min-width: 0;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            text-overflow: ellipsis;
            vertical-align: middle;
            position: relative;
            text-align: left;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="content-header">
        <h1>统计分析
            <small>排行榜</small>
        </h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>排行榜</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <div class="filter-container">
                <el-date-picker
                        v-model="value1"
                        type="date"
                        format="yyyy-MM-dd "
                        value-format="yyyy-MM-dd "
                        placeholder="选择日期时间">
                </el-date-picker>
                <el-button type="primary" @click="clickBtn">确定</el-button>
            </div>
            <el-table size="small" current-row-key="id" :data="dataList"
                      :default-sort="{prop: 'count', order: 'descending'}" stripe highlight-current-row>
                <el-table-column type="index" align="center" label="排名"></el-table-column>
                <el-table-column prop="chineseName" label="名称" align="center"></el-table-column>
                <el-table-column prop="name" label="名称关键字" align="center"></el-table-column>
                <el-table-column prop="count" label="次数" align="center"></el-table-column>
            </el-table>
        </div>
    </div>

</div>

<script type="text/javascript">
    new Vue({
        el: "#app",
        data: {
            value1: getToday(),
            dataList: [{
                // chineseName:1,
                // name: 123,
                // count: 1
            }]
        },
        created() {
            // console.log(getToday());
            // axios.get("/ranking/rankCheckItemAndCheckGroup.do?date=" + getToday()).then((resp) => {
            //     if (resp.data.flag) {
            //         console.log(resp.data.data);
            //         this.dataList = resp.data.data;
            //     } else {
            //         this.$message.error(resp.data.message);
            //     }
            // });
            setInterval(this.clickBtn, 5000);
            this.clickBtn();
        },
        methods: {
            clickBtn() {
                console.log(this.value1);
                axios.get("/ranking/rankCheckItemAndCheckGroup.do?date=" + this.value1).then((resp) => {
                    if (resp.data.flag) {
                        // console.log(resp.data.data);
                        this.dataList = resp.data.data;
                    } else {
                        this.$message.error(resp.data.message);
                    }
                });


            }
        }
    });

</script>
</body>

</html>
